<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/axios-0.21.0.js"></script>
    <script src="js/vue-2.6.12.js"></script>
    <script src="js/vue-router-3.4.9.js"></script>
</head>
<body>

<div id="app">

    <form >
        id:<input type="text" name="id" v-model="user.id">
        name:<input type="text" name="name" v-model="user.name">
        age:<input type="text" name="age" v-model="user.age">
        sex:<input type="text" name="sex" v-model="user.sex">
        address:<input type="text" name="address" v-model="user.address">
        <button type="button" @click="getUser">获取User</button>

    </form>

</div>

<script>

    let app = new Vue({

        el:"#app",
        data:{
            user:{}
        },
        methods:{
            getUser:function () {

                axios.get("/day02_json/getUser?id=1",).then(resp=>{

                    this.user = resp.data;

                }).catch(error=>{

                })


            }
        }

    })

</script>


</body>
</html>